﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharp_Class_and_object

{
    public class Equipment3
    {
        private int _equipId = 0;
        public int EquipID
        {
            get
            {
                return _equipId;
            }
            set
            {
                 _equipId = value;
            }
        }
        public string EquipName { get; set; } = "空压机"; //设备名称
        public double Pressure
        {
            get
            {
                //从下位机传感器中读取数据...这里省略...
                double result = 2.5;
                return result;
            }
        } //压力
        public double GetPressure()
        {
            double result = 2.5;
            return result;
        }
        /*静态属性：描述对象的基本特征信息(数据）(属性)
        动态属性：描述这个对象能做什么，如何做？(方法)*/

        //属性表达式
        public DateTime CollectionTime { get; set; } //采集时间
        public DateTime CollectionTime2 { get => DateTime.Now; }
        public DateTime CollectionTime3 => DateTime.Now.AddDays(1.0);
        /// <summary>
        ///     显示设备的信息
        /// </summary>
        public string Equipinfo { get; } = "软件预安装高级版本";
    }
}
